package com.lsy.mapper.interf;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.lsy.entity.ProductCustom;
import com.lsy.entity.ProductQueryVo;

/**
 * mapper必須要MapperInterface
 * 
 * @author Administrator
 *
 */
public interface ProductMapperCustom extends MapperInterface<ProductQueryVo> {

	public int insert(ProductCustom product);
	
	// 后台商品列表
	public List<ProductCustom> findIproductsList(ProductQueryVo productQueryVo) throws Exception;

	/**
	 * 分页查询
	 * 
	 * @param from
	 *            开始位置
	 * @param number
	 *            查询数目
	 * @return list集合
	 * @throws Exception
	 */
	public List<ProductCustom> findProductByPage(@Param("from") int from, @Param("number") int number) throws Exception;
	
	/**
	 * 分页查找已经满额的
	 * @param from
	 * @param number
	 * @return
	 * @throws Exception
	 */
	public List<ProductCustom> findIsDoneProductByPage(@Param("from") int from,@Param("number") int number) throws Exception;
	/**
	 * 查找满额的总数
	 * @return
	 * @throws Exception
	 */
	public int findIsDoneTotal() throws Exception;

	/**
	 * 查询总数
	 * 
	 * @return 总数
	 * @throws Exception
	 */
	public int findTotal() throws Exception;

	/**
	 * 通过id查询
	 * 
	 * @param id
	 *            product的id
	 * @return product
	 */
	public ProductCustom findProductById(int id) throws Exception;

	/**
	 * 投标成功是更新相关数据
	 * 
	 * @param product
	 *            需要更新的对象
	 * @return 大于0成功
	 * @throws Exception
	 */
	public int updateProduct(@Param("product") ProductCustom product, @Param("isComplete") boolean isComplete)
			throws Exception;
	
	public int update(ProductCustom product);
	
	public int delete(int id);

}